The Accordion Pane Component > FAccordionPane.setDataProvider()

 

FAccordionPane.setDataProvider()

Availability

Flash Player 6.

Usage

myAccordion_acp.setDataProvider (dataProvider)

Parameters

dataProvider A DataProvider that will be used to create and populate sections of the component.

Returns


Nothing

Description

This specifies the DataProvider that should be used to create and populate sections of the component. The DataProvider should have the following fields,

label

The name of the section.

linkage

The linkage id of the content within the section.

If a DataProvider already exists within the component, the new DataProvider will overwrite it and replace any data, content and sections from the previous DataProvider.

Example

The accordion_setDataProvider.fla example file contains an example of using this method.

The following code creates a DataProvider instances and uses it to configure and populate the component.

	var sections = ["Section 1","Section 2","Section 3","Section 4"];
	myAccordionPane_acp.setDataProvider(sections);

	var item = myAccordionPane_acp.getItemAt(2);
	trace("Item Label: "+item.label); // traces "Item Label: Section 3"

 

See also

FAccordionPane.getDataProvider()